package com.todo.strategy.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author zhangwenxiang
 * @date 2024/3/17 20:10
 * @description
 */
@Getter
@AllArgsConstructor
public enum TravelDayTypeEnum {

    ONE_DAY(1, "ONE_DAY", "1日游",1),
    TWE_DAY(2, "TWE_DAY", "2日游",2),
    THREE_DAY(3, "THREE_DAY", "3日游",3),
    FOUR_DAY(4, "FOUR_DAY", "4日游",4),
    FIVE_DAY(5, "FIVE_DAY", "5日游",5),
    SIX_DAY(6, "SIX_DAY", "6日游",6),
    SEVEN_DAY(7, "SEVEN_DAY", "7日游",7),
    MINOR_VACATION(8, "MINOR_VACATION", "小长假",10),
    FIFTEEN_DAY(9, "FIFTEEN_DAY", "15天假期",15),
    HOLIDAY(10, "HOLIDAY", "度假",30),
    ;

    private static Map<Integer, TravelDayTypeEnum> typeMap = Arrays
            .stream(TravelDayTypeEnum.values())
            .collect(Collectors.toMap(TravelDayTypeEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;
    private Integer days;


    public static TravelDayTypeEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
